From 215aa87cfce77a4e14dad26eb7b2885c01952b83 Mon Sep 17 00:00:00 2001
From: Leonardo Bishop <me@leonardobishop.com>
Date: Sat, 23 Aug 2025 23:03:29 +0100
Subject: Fix OIDC flow

---
 web/pages/login/[[provider]].vue | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

(limited to 'web/pages/login/[[provider]].vue')

diff --git a/web/pages/login/[[provider]].vue b/web/pages/login/[[provider]].vue
index 58cf2b1..a5654e7 100644
--- a/web/pages/login/[[provider]].vue
+++ b/web/pages/login/[[provider]].vue
@@ -70,14 +70,7 @@ const handleOIDCAuth = async (providerName: string) => {
     headers: headers,
     server: false,
     onResponse: ({ response }) => {
-      if (response._data.data.url) {
-        navigateTo(response._data.data.url, { external: true })
-      } else {
-        authStore.token = response._data.data.token
-        authStore.admin = response._data.data.admin
-
-        navigateTo("/");
-      }
+      navigateTo(response._data.data.url, { external: true })
     },
     onResponseError: authFail
   });
@@ -110,6 +103,10 @@ onMounted(async () => {
         throw Error()
       }
 
+      authStore.token = response.data.token
+      authStore.username = response.data.username
+      authStore.admin = response.data.admin
+
       navigateTo("/");
     } catch (e: any) {
       if ((e as FetchError).data) {
-- 
cgit v1.2.3-70-g09d2

